package com.example.malllocationserver.utils;

import com.example.malllocationserver.entity.data.Wifi;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Split {
    //对Wifi信息的切割
    public Map<String , Integer> WifiSplit(String data){
        String[] datalist = data.split(";\n");
        Map<String , Integer> WifiData = new HashMap<>();
        for(String data_ : datalist){
            String[] _data = data_.split("-");
            WifiData.put(_data[0] , -Integer.valueOf(_data[1]));
        }
        return WifiData;
    }
    //对地磁坐标的切割
    public double[] LoadSplit(String data){
        String[] data_ = data.split(":");
        double[] _data = new double[3];
        for(int i=0;i<3;i++)
            _data[i] = Double.parseDouble(data_[i]);
        return _data;
    }
}
